package com.situ.struts.action;

import org.apache.struts2.components.Push;

import com.opensymphony.xwork2.ActionSupport;

public class UserAction extends ActionSupport{
	//set必须要写，get可以不写
	private String name;
	private String password;
	private Integer age;
	
	public UserAction() {
		System.out.println("UserAction.UserAction()");
	}
	
	public String register() {
		System.out.println(name);
		System.out.println(password);
		System.out.println(age);
		return "success";
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public void setAge(Integer age) {
		this.age = age;
	}

	@Override
	public String execute() throws Exception {
		System.out.println("UserAction.execute()");
		return "success";
	}
	
	public String add() {
		System.out.println("UserAction.add()");
		return "add";
	}
	
	public String delete() {
		System.out.println("UserAction.delete()");
		return "delete";
	}
	
	public String update() {
		System.out.println("UserAction.update()");
		return "success";
	}
	
	
	
}
